package kr.hkit.Powerjava.chapter07.work;

public class Date {
	
	private int year;
	private int month;
	private int day;
	public Date(int year, int month, int day) {
		super();
		this.year = year;
		this.month = month;
		this.day = day;
		print();
		print2();
	}
	public void print() {
		switch(month){
			case 1:
				System.out.print("Jan");
				break;
			case 2:
				System.out.print("Feb");
				break;
			case 3:
				System.out.print("Mar");
				break;
			case 4:
				System.out.print("Apr");
				break;
			case 5:
				System.out.print("May");
				break;
			case 6:
				System.out.print("Jun");
				break;
			case 7:
				System.out.print("Jul");
				break;
			case 8:
				System.out.print("Aug");
				break;
			case 9:
				System.out.print("Sep");
				break;
			case 10:
				System.out.print("Nov");
				break;
			case 11:
				System.out.print("Oct");
				break;
			case 12:
				System.out.print("Dec");
				break;
		}
		System.out.printf(" %d, %d%n",day,year);
	}
	public void print2(){
		System.out.printf("%d. %d. %d%n",year,month,day);
	}
	@Override
	public String toString() {
		return String.format("Date [%d. %d. %d]", year, month,day);
	}
	
}
